package com.demo.controller;


import com.demo.controller.from.LoginFrom;
import com.demo.exetion.MainExection;
import com.demo.service.MovieUserService;
import com.demo.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 杨森
 * @since 2022-04-13
 */
@RestController
@RequestMapping("/movieUser")
@Api(value = "用户", tags = "用户")
public class MovieUserController {

    @Resource
    private MovieUserService movieUserService;

    @PostMapping("/login")
    @ApiOperation(value = "登录", notes = "登录")
    public Result<String> login(@RequestBody LoginFrom loginFrom) throws MainExection {
        String login = movieUserService.login(loginFrom);
        return Result.getInstance(String.class).setData(login);
    }
}

